package com.xqt.dao.message;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Repository;

import com.xqt.base.dao.BaseDao;
import com.xqt.base.entity.BaseEntity;
import com.xqt.entity.message.MessageBase;


@Repository
public class MessageBaseDao extends BaseDao<MessageBase> {

	@Autowired
	@Qualifier("readSqlSession")
	private SqlSessionTemplate readSqlSession;

	@Autowired
	@Qualifier("writeSqlSession")
	private SqlSessionTemplate writeSqlSession;
	
	@Override
	public String getReadSql() {
		return "read.messageBase.";
	}

	@Override
	public String getWriteSql() {
		return "write.messageBase.";
	}
	
	
	/**列表查询*/
	public int queryCount(BaseEntity page){
		return readSqlSession.selectOne(getReadSql()+"queryCount", page);
	}
	public List<MessageBase> queryList(BaseEntity page){
		return readSqlSession.selectOne(getReadSql()+"queryList", page);
	}

}
